<template>

  <el-container style="padding:20px 0px 0px 20px; position:absolute; left:0; top:0; width:100%;height:100%;">

    <el-header>
      <el-form :inline="true">

        <el-form-item label="激活编辑" prop="editStatus">
          <el-switch v-model="editStatus"></el-switch>
        </el-form-item>
        <el-form-item >
          <el-button type="primary" @click="submitUpdation()">提交修改</el-button>
        </el-form-item>

        <el-form-item style="float: right">
          <el-button type="infl" @click="returnAllSpecies()" >返回试验田</el-button>
        </el-form-item>

      </el-form>
    </el-header>

    <el-main>

      <el-scrollbar>

        <el-col :span="24" class="toolbar">
          <el-form :model="plotData" :rules="rules" ref="ruleForm" label-width="200px">

            <div class="crumbs">
              <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-message"></i> 品种基本信息 </el-breadcrumb-item>
              </el-breadcrumb>
            </div>

            <el-form-item label="1-品种ID" prop="speciesId">
              <el-input v-model="plotData.localSpecies.speciesId" disabled="true"></el-input>
            </el-form-item>
            <el-form-item label="1-1-试验ID" prop="testId">
              <el-input v-model="plotData.commontest.testId" disabled="true"></el-input>
            </el-form-item>
            <el-form-item label="2-试验类型" prop="experiment_type">
              <el-input v-model="plotData.commontest.experimentType" disabled="true"></el-input>
            </el-form-item>


            <div class="clear"></div>
            <el-form-item label="3-播种期">
              <el-date-picker
                v-model="plotData.commontest.plantingDate"
                align="right"
                type="date"
                placeholder="选择日期"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :picker-options="pickerOptions1"
                :disabled="!editStatus">
              </el-date-picker>
            </el-form-item>
            <div class="clear"></div>

            <el-form-item label="4-出苗期">
              <el-date-picker
                v-model="plotData.commontest.emergenceDate"
                align="right"
                type="date"
                placeholder="选择日期"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :picker-options="pickerOptions1"
                :disabled="!editStatus">
              </el-date-picker>
            </el-form-item>


            <el-form-item label="5-出苗率(%)" prop="breedingMethods">
              <el-input-number v-model="plotData.commontest.sproutRate" :min="0" :max="100" :disabled="!editStatus"
                               label="出苗率">
              </el-input-number>
            </el-form-item>

            <div class="clear"></div>
            <el-form-item label="6-现蕾期">
              <el-date-picker
                v-model="plotData.commontest.squaringStage"
                align="right"
                type="date"
                placeholder="选择日期"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :picker-options="pickerOptions1"
                :disabled="!editStatus">
              </el-date-picker>
            </el-form-item>
            <div class="clear"></div>
            <el-form-item label="7-开花期">
              <el-date-picker
                v-model="plotData.commontest.blooming"
                align="right"
                type="date"
                placeholder="选择日期"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :picker-options="pickerOptions1"
                :disabled="!editStatus">
              </el-date-picker>
            </el-form-item>

            <el-form-item label="8-叶颜色">
              <el-radio-group v-model="plotData.localSpecies.leafColour" size="small" :disabled="!editStatus">
                <el-radio-button label="浅绿"></el-radio-button>
                <el-radio-button label="绿"></el-radio-button>
                <el-radio-button label="深绿"></el-radio-button>
              </el-radio-group>
            </el-form-item>
            <div class="clear"></div>

            <el-form-item label="9-花冠色">
              <el-radio-group v-model="plotData.localSpecies.corollaColour" size="small" :disabled="!editStatus">
                <el-radio-button label="白"></el-radio-button>
                <el-radio-button label="浅红"></el-radio-button>
                <el-radio-button label="红"></el-radio-button>
                <el-radio-button label="红紫"></el-radio-button>
                <el-radio-button label="紫"></el-radio-button>
                <el-radio-button label="蓝紫"></el-radio-button>
                <el-radio-button label="蓝"></el-radio-button>
                <el-radio-button label="黄"></el-radio-button>
              </el-radio-group>
            </el-form-item>

            <div class="clear"></div>

            <el-form-item label="10-花繁茂性">
              <el-radio-group v-model="plotData.localSpecies.flowering" size="small" :disabled="!editStatus">
                <el-radio-button label="无"></el-radio-button>
                <el-radio-button label="少"></el-radio-button>
                <el-radio-button label="中"></el-radio-button>
                <el-radio-button label="多"></el-radio-button>
              </el-radio-group>
            </el-form-item>

            <div class="clear"></div>

            <el-form-item label="11-茎色">
              <el-radio-group v-model="plotData.localSpecies.stemColour" size="small" :disabled="!editStatus">
                <el-radio-button label="绿"></el-radio-button>
                <el-radio-button label="褐"></el-radio-button>
                <el-radio-button label="紫"></el-radio-button>
                <el-radio-button label="深紫"></el-radio-button>
                <el-radio-button label="局部有紫色"></el-radio-button>
              </el-radio-group>
            </el-form-item>

            <div class="clear"></div>

            <el-form-item label="12-天然结实性">
              <el-radio-group v-model="plotData.localSpecies.openpollinated" size="small" :disabled="!editStatus">
                <el-radio-button label="无"></el-radio-button>
                <el-radio-button label="弱"></el-radio-button>
                <el-radio-button label="中"></el-radio-button>
                <el-radio-button label="强"></el-radio-button>
                <el-radio-button label="极强"></el-radio-button>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="13-成熟期">
              <el-date-picker
                v-model="plotData.commontest.maturingStage"
                align="right"
                type="date"
                placeholder="选择日期"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :picker-options="pickerOptions1"
                :disabled="!editStatus">
              </el-date-picker>
            </el-form-item>

            <el-form-item label="14-生育日数(天)" prop="breedingMethods">
            <el-input-number v-model="plotData.commontest.growingPeriod" :min="0" :max="10000" :disabled="!editStatus"
            label="生育日数(天)"></el-input-number>
            </el-form-item>

            <el-form-item label="15(1)-分枝数1" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber1" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15(2)-分枝数2" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber2" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15(3)-分枝数3" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber3" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15(4)-分枝数4" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber4" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15(5)-分枝数5" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber5" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15(6)-分枝数6" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber6" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15(7)-分枝数7" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber7" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15(8)-分枝数8" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber8" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15(9)-分枝数9" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber9" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15(10)-分枝数10" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigBranchNumber10" @blur="getBranchNumber()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="15-平均分枝数" prop="observationLocation" style>
              <el-input v-model="plotData.commontest.branchNumberAvg" :disabled="true"></el-input>
            </el-form-item>
            <div class="clear"></div>

            <el-form-item label="16(1)-株高1" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight1" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16(2)-株高2" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight2" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16(3)-株高3" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight3" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16(4)-株高4" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight4" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16(5)-株高5" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight5" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16(6)-株高6" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight6" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16(7)-株高7" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight7" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16(8)-株高8" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight8" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16(9)-株高9" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight9" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16(10)-株高10" prop="observationLocation" style="width: 700px">
              <el-input v-model="plotData.commontest.bigPlantHeight10" @blur="getplantHeightAvg()":disabled="!editStatus"></el-input>
            </el-form-item>

            <el-form-item label="16-平均株高" prop="observationLocation" style>
              <el-input v-model="plotData.commontest.plantHeightAvg" :disabled="true"></el-input>
            </el-form-item>
            <div class="clear"></div>


            <el-form-item label="17-整齐度">
              <el-radio-group v-model="plotData.localSpecies.uniformityOfTuberSize" size="small" :disabled="!editStatus">
                <el-radio-button label="整齐"></el-radio-button>
                <el-radio-button label="中"></el-radio-button>
                <el-radio-button label="不整齐"></el-radio-button>
              </el-radio-group>
            </el-form-item>
            <div class="clear"></div>

            <el-form-item label="18-薯形" prop="longitude" :disabled="!editStatus">
              <el-select v-model="plotData.localSpecies.tuberShape" clearable placeholder="请选择">
                <el-option
                  v-for="item in tuberShaps"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <div class="clear"></div>

            <el-form-item label="19-薯皮类型">
              <el-radio-group v-model="plotData.localSpecies.skinSmotthness" size="small" :disabled="!editStatus">
                <el-radio-button label="光滑"></el-radio-button>
                <el-radio-button label="中"></el-radio-button>
                <el-radio-button label="粗糙"></el-radio-button>
              </el-radio-group>
            </el-form-item>

            <div class="clear"></div>

            <el-form-item label="20-芽眼深浅">
              <el-radio-group v-model="plotData.localSpecies.eyeDepth" size="small" :disabled="!editStatus">
                <el-radio-button label="浅"></el-radio-button>
                <el-radio-button label="中"></el-radio-button>
                <el-radio-button label="深"></el-radio-button>
              </el-radio-group>
            </el-form-item>
            <div class="clear"></div>

            <el-form-item label="21-皮色" prop="longitude" :disabled="!editStatus">
              <el-select v-model="plotData.localSpecies.skinColour" clearable placeholder="请选择">
                <el-option
                  v-for="item in skinColours"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="22-肉色" prop="longitude" :disabled="!editStatus">
              <el-select v-model="plotData.localSpecies.fleshColour" clearable placeholder="请选择">
                <el-option
                  v-for="item in fleshColours"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>

            <div class="clear"></div>
            <el-form-item label="23-是否入选">
              <el-switch
                v-model="plotData.localSpecies.isChoozen"
                active-text="是"
                inactive-text="否"
                active-color="#13ce66"
                inactive-color="#ff4949"
                :disabled="!editStatus">
              </el-switch>
            </el-form-item>

            <div class="clear"></div>
            <el-form-item label="24-收获株数" prop="releasingYear">
              <el-input-number v-model="plotData.commontest.harvestNum" :min="0" :max="10000" :disabled="!editStatus"
                               label="收获株数"></el-input-number>
            </el-form-item>
            <div class="clear"></div>

            <el-form-item label="25-大中薯数" prop="breedingMethods">
              <el-input-number v-model="plotData.commontest.lmNum" :min="0" :max="10000" :disabled="!editStatus"
                               label="大中薯数"></el-input-number>
            </el-form-item>

            <div class="clear"></div>

            <el-form-item label="26-大中薯重(0.00 kg)" prop="biologicalStatusOfAccession">
              <el-input-number v-model="plotData.commontest.lmWeight" precision="2" :min="0" :max="10000" :disabled="!editStatus"
                               label="大中薯重"></el-input-number>
            </el-form-item>
            <div class="clear"></div>


            <el-form-item label="27-小薯数" prop="breedingMethods">
              <el-input-number v-model="plotData.commontest.sNum" :min="0" :max="10000" :disabled="!editStatus"
                               label="小薯数"></el-input-number>
            </el-form-item>

            <el-form-item label="28-小薯重(0.00 kg)" prop="biologicalStatusOfAccession">
              <el-input-number v-model="plotData.commontest.sWeight" precision="2" :min="0" :max="10000" :disabled="!editStatus"
                               label="小薯重"></el-input-number>
            </el-form-item>
            <div class="clear"></div>

            <el-form-item label="29-商品薯率(%)" prop="breedingMethods">
              <el-input-number v-model="plotData.commontest.commercialRate" :min="0" :max="100" :disabled="!editStatus"
                               label="商品薯率">

              </el-input-number>
            </el-form-item>
            <div class="clear"></div>

            <el-form-item label="30(1)-小区产量1(0.00 kg)" prop="biologicalStatusOfAccession">
              <el-input-number v-model="plotData.commontest.plotYield1" precision="2" :min="0" :max="10000" :disabled="!editStatus"
                               label="小区产量1"></el-input-number>
            </el-form-item>
            <div class="clear"></div>
            <el-form-item label="30(2)-小区产量2(0.00 kg)" prop="biologicalStatusOfAccession">
              <el-input-number v-model="plotData.commontest.plotYield2" precision="2" :min="0" :max="10000" :disabled="!editStatus"
                               label="小区产量2"></el-input-number>
            </el-form-item>
            <div class="clear"></div>
            <el-form-item label="30(3)-小区产量3(0.00 kg)" prop="biologicalStatusOfAccession">
              <el-input-number v-model="plotData.commontest.plotYield3" precision="2" :min="0" :max="10000" :disabled="!editStatus"
                               label="小区产量3"></el-input-number>
            </el-form-item>
            <div class="clear"></div>
            <el-form-item label="31-亩产量(0.00 kg)" prop="biologicalStatusOfAccession">
              <el-input-number v-model="plotData.commontest.acreYield" precision="2" :min="0" :max="10000" :disabled="!editStatus"
                               label="亩产量"></el-input-number>
            </el-form-item>
            <div class="clear"></div>




            <el-form-item label="18-备注" prop="breedingInstitute" style="width: 700px">
              <el-input
                type="textarea"
                autosize
                placeholder="请输入内容"
                v-model="plotData.commontest.remark" :disabled="!editStatus">
              </el-input>
            </el-form-item>

            <el-carousel :interval="4000" type="card" height="400px" style="max-width: 1000px; margin: auto">
              <el-carousel-item v-for="item in speciesImgs" :key="item">
                <div>
                  <img :src="item" style="min-width:100%; min-height:100% ; width:100%; height:60%"/>
                </div>
              </el-carousel-item>
            </el-carousel>



            <!--<div class="clear"></div>-->
            <!--<el-form-item label="8-花冠色">-->
              <!--<el-radio-group v-model="plotData.corolla_colour" size="small" :disabled="!editStatus">-->
                <!--<el-radio-button label="白"></el-radio-button>-->
                <!--<el-radio-button label="浅红"></el-radio-button>-->
                <!--<el-radio-button label="红"></el-radio-button>-->
                <!--<el-radio-button label="红紫"></el-radio-button>-->
                <!--<el-radio-button label="紫"></el-radio-button>-->
                <!--<el-radio-button label="蓝紫"></el-radio-button>-->
                <!--<el-radio-button label="蓝"></el-radio-button>-->
                <!--<el-radio-button label="黄"></el-radio-button>-->
              <!--</el-radio-group>-->
            <!--</el-form-item>-->

            <!--<div class="clear"></div>-->
            <!--<el-form-item label="9-花繁茂性">-->
              <!--<el-radio-group v-model="plotData.flowering" size="small" :disabled="!editStatus">-->
                <!--<el-radio-button label="无"></el-radio-button>-->
                <!--<el-radio-button label="少"></el-radio-button>-->
                <!--<el-radio-button label="中"></el-radio-button>-->
                <!--<el-radio-button label="多"></el-radio-button>-->
              <!--</el-radio-group>-->
            <!--</el-form-item>-->

            <!--<div class="clear"></div>-->
            <!--<el-form-item label="10-茎色">-->
              <!--<el-radio-group v-model="plotData.stem_colour" size="small" :disabled="!editStatus">-->
                <!--<el-radio-button label="绿"></el-radio-button>-->
                <!--<el-radio-button label="褐"></el-radio-button>-->
                <!--<el-radio-button label="紫"></el-radio-button>-->
                <!--<el-radio-button label="深紫"></el-radio-button>-->
                <!--<el-radio-button label="局部有紫色"></el-radio-button>-->
              <!--</el-radio-group>-->
            <!--</el-form-item>-->

            <!--<div class="clear"></div>-->
            <!--<el-form-item label="11-天然结实性">-->
              <!--<el-radio-group v-model="plotData.openpollinated" size="small" :disabled="!editStatus">-->
                <!--<el-radio-button label="无"></el-radio-button>-->
                <!--<el-radio-button label="弱"></el-radio-button>-->
                <!--<el-radio-button label="中"></el-radio-button>-->
                <!--<el-radio-button label="强"></el-radio-button>-->
                <!--<el-radio-button label="极强"></el-radio-button>-->
              <!--</el-radio-group>-->
            <!--</el-form-item>-->
            <!--<div class="clear"></div>-->
            <!--<el-form-item label="12-成熟期">-->
              <!--<el-date-picker-->
                <!--v-model="plotData.maturing_stage"-->
                <!--align="right"-->
                <!--type="date"-->
                <!--placeholder="选择日期"-->
                <!--format="yyyy-MM-dd"-->
                <!--value-format="yyyy-MM-dd"-->
                <!--:picker-options="pickerOptions1"-->
                <!--:disabled="!editStatus">-->
              <!--</el-date-picker>-->
            <!--</el-form-item>-->
            <!--<div class="clear"></div>-->

            <!--<el-form-item label="13-生育日数" prop="breedingMethods">-->
              <!--<el-input-number v-model="plotData.growing_period" :min="0" :max="10000" :disabled="!editStatus"-->
                               <!--label="生育日数"></el-input-number>-->
            <!--</el-form-item>-->
            <!--<div class="clear"></div>-->
            <!--<el-form-item label="14-块茎整齐度">-->
              <!--<el-radio-group v-model="plotData.uniformity_of_tuber_size" size="small" :disabled="!editStatus">-->
                <!--<el-radio-button label="整齐"></el-radio-button>-->
                <!--<el-radio-button label="中"></el-radio-button>-->
                <!--<el-radio-button label="不整齐"></el-radio-button>-->
              <!--</el-radio-group>-->
            <!--</el-form-item>-->
            <!--<div class="clear"></div>-->
            <!--<el-form-item label="15-薯形" prop="longitude" :disabled="!editStatus">-->
              <!--<el-select v-model="plotData.tuber_shape" clearable placeholder="请选择">-->
                <!--<el-option-->
                  <!--v-for="item in tuberShaps"-->
                  <!--:key="item.value"-->
                  <!--:label="item.label"-->
                  <!--:value="item.value">-->
                <!--</el-option>-->
              <!--</el-select>-->
            <!--</el-form-item>-->
            <!--<div class="clear"></div>-->
            <!--<el-form-item label="16-薯皮光滑度">-->
              <!--<el-radio-group v-model="plotData.skin_smoothness" size="small" :disabled="!editStatus">-->
                <!--<el-radio-button label="光滑"></el-radio-button>-->
                <!--<el-radio-button label="中"></el-radio-button>-->
                <!--<el-radio-button label="粗糙"></el-radio-button>-->
              <!--</el-radio-group>-->
            <!--</el-form-item>-->

            <!--<div class="clear"></div>-->
            <!--<el-form-item label="17-芽眼深浅">-->
              <!--<el-radio-group v-model="plotData.eye_depth" size="small" :disabled="!editStatus">-->
                <!--<el-radio-button label="浅"></el-radio-button>-->
                <!--<el-radio-button label="中"></el-radio-button>-->
                <!--<el-radio-button label="深"></el-radio-button>-->
              <!--</el-radio-group>-->
            <!--</el-form-item>-->
            <!--<div class="clear"></div>-->

            <!--<el-form-item label="18-皮色" prop="longitude" :disabled="!editStatus">-->
              <!--<el-select v-model="plotData.skin_colour" clearable placeholder="请选择">-->
                <!--<el-option-->
                  <!--v-for="item in skinColours"-->
                  <!--:key="item.value"-->
                  <!--:label="item.label"-->
                  <!--:value="item.value">-->
                <!--</el-option>-->
              <!--</el-select>-->
            <!--</el-form-item>-->

            <!--<el-form-item label="19-肉色" prop="longitude" :disabled="!editStatus">-->
              <!--<el-select v-model="plotData.flesh_colour" clearable placeholder="请选择">-->
                <!--<el-option-->
                  <!--v-for="item in fleshColours"-->
                  <!--:key="item.value"-->
                  <!--:label="item.label"-->
                  <!--:value="item.value">-->
                <!--</el-option>-->
              <!--</el-select>-->
            <!--</el-form-item>-->

            <!--<div class="clear"></div>-->
            <!--<el-form-item label="20-是否入选">-->
              <!--<el-switch-->
                <!--v-model="plotData.is_choozen"-->
                <!--active-text="是"-->
                <!--inactive-text="否"-->
                <!--active-color="#13ce66"-->
                <!--inactive-color="#ff4949"-->
                <!--:disabled="!editStatus">-->
              <!--</el-switch>-->
            <!--</el-form-item>-->

<!--            <el-form-item label="34-十株的分支数(以“-”符分隔)" prop="observationLocation" style="width: 700px">-->
<!--              <el-input v-model="plotData.branch_number10" @blur="getbranchNumberAvg()"-->
<!--                        :disabled="!editStatus"></el-input>-->
<!--            </el-form-item>-->

            <!--<el-form-item label="36-十株测产(以“-”符分隔)" prop="observationLocation" style="width: 700px">-->
              <!--<el-input v-model="plotData.yield10" :disabled="!editStatus"></el-input>-->
            <!--</el-form-item>-->


          </el-form>
        </el-col>

      </el-scrollbar>

    </el-main>
  </el-container>

</template>

<script>
  import {getSpeciesDetail, updateSpeciesDetail} from '@/api/SpeciesManage'
  import {getPlotData,updatePlotData} from '@/api/FarmlandManage'
  //V2.0
  //import { getCommontestList, updateCommontest} from '../../../api/commontestManage'
  import { getSpeciesCommontestList, updateCommontest } from '../../../api/speciesCommontestManage'

  export default {
    data() {
      var checkRate = (rule, value, callback) => {
        setTimeout(() => {
          var re = /^[0-9]+.?[0-9]*/;
          if (!re.test(value)) {
            callback(new Error('请输入数字值'));
          } else {
            if (value < 0 || value > 100) {
              callback(new Error('出苗率必须在0~100之间(%)'));
            } else {
              callback();
            }
          }
        }, 1000);
      };
      return {
        tuberShaps: [
          {value: '扁圆', label: '扁圆'},
          {value: '圆形', label: '圆形'},
          {value: '卵形', label: '卵形'},
          {value: '倒卵', label: '倒卵'},
          {value: '扁椭圆', label: '扁椭圆'},
          {value: '椭圆', label: '椭圆'},
          {value: '长方', label: '长方'},
          {value: '长筒', label: '长筒'},
          {value: '棍棒', label: '棍棒'},
          {value: '楔形', label: '楔形'},
          {value: '肾形', label: '肾形'},
          {value: '纺锤', label: '纺锤'},
          {value: '镰刀', label: '镰刀'},
          {value: '卷曲', label: '卷曲'},
          {value: '掌状', label: '掌状'},
          {value: '手风琴', label: '手风琴'},
          {value: '结节', label: '结节'}
        ],
        skinColours: [
          {value: '乳白', label: '乳白'},
          {value: '浅黄', label: '浅黄'},
          {value: '黄', label: '黄'},
          {value: '褐', label: '褐'},
          {value: '浅红', label: '浅红'},
          {value: '红', label: '红'},
          {value: '深红', label: '深红'},
          {value: '紫', label: '紫'},
          {value: '深紫', label: '深紫'},
          {value: '锈色', label: '锈色'},
          {value: '红杂色', label: '红杂色'},
          {value: '蓝紫杂色', label: '蓝紫杂色'}
        ],
        fleshColours: [
          {value: '白', label: '白'},
          {value: '乳白', label: '乳白'},
          {value: '浅黄', label: '浅黄'},
          {value: '黄', label: '黄'},
          {value: '深黄', label: '深黄'},
          {value: '橙', label: '橙'},
          {value: '红', label: '红'},
          {value: '浅紫', label: '浅紫'},
          {value: '紫', label: '紫'},
          {value: '蓝紫', label: '蓝紫'},
          {value: '红纹或紫纹', label: '红纹或紫纹'}
        ],

        curSpecies: {},
        pickerOptions1: {
          disabledDate(time) {
            return false;
            //return time.getTime() > Date.now();
          },
          shortcuts: [{
            text: '今天',
            onClick(picker) {
              picker.$emit('pick', new Date());
            }
          }, {
            text: '昨天',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit('pick', date);
            }
          }, {
            text: '一周前',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', date);
            }
          }]
        },
        winHeight: window.innerHeught - 50,
        speciesDetail: {
          speciesId: '',
          accessionNumber: '',
          genebankNumber: '',
          introducingNumber: '',
          collectingNumber: '',
          accessionName: '',
          alienName: '',
          family: '',
          genus: '',
          species: '',
          countryOfOrigin: '',
          provinceOfOrigin: '',
          origin: '',
          altitude: '',
          longitude: '',
          latitude: '',
          sampleSource: '',
          donorInstitute: '',
          donorAccessionNumber: '',
          pedigree: '',
          breedingInstitute: '',
          releasingYear: '',
          breedingMethods: '',
          biologicalStatusOfAccession: '',
          imageFileName: '',
          observationLocation: '',
        },
        plotData: {
          // localSpecies部分
          localSpecies: {
            speciesId: '',
            maleParentId: '',
            femaleParentID: '',
            projectId: '',
            experimentType: '',
            leafColour: '',
            corollaColour: '',
            flowering: '',
            stemColour: '',
            openpollinated: '',
            uniformityOfTuberSize: '',
            tuberShape: '',
            skinSmotthness: '',
            eyeDepth: '',
            skinColour: '',
            fleshColour: '',
            img1: '',
            img2: '',
            img3: '',
            img4: '',
            img5: ''
          },
          commontest: {
            // commontest部分
            testId: '',
            experimentType: '',
            plantingDate: '',
            emergenceDate: '',
            sproutRate: 0.0,
            squaringStage: '',
            blooming: '',
            maturingStage: '',
            growingPeriod: 0,
            harvestNum: 0,
            lmNum: 0,
            lmWeight: 0.0,
            sNum: 0,
            sWeight: 0.0,
            commercialRate: 0.0,

            plotYield1: 0.0,
            plotYield2: 0.0,
            plotYield3: 0.0,
            acreYield: 0.0,

            // 株高统计数据
            bigPlantHeight1: 0.0,
            bigPlantHeight2: 0.0,
            bigPlantHeight3: 0.0,
            bigPlantHeight4: 0.0,
            bigPlantHeight5: 0.0,
            bigPlantHeight6: 0.0,
            bigPlantHeight7: 0.0,
            bigPlantHeight8: 0.0,
            bigPlantHeight9: 0.0,
            bigPlantHeight10: 0.0,

            plantHeightAvg: 0.0,

            // 分枝数统计数据
            bigBranchNumber1: 0,
            bigBranchNumber2: 0,
            bigBranchNumber3: 0,
            bigBranchNumber4: 0,
            bigBranchNumber5: 0,
            bigBranchNumber6: 0,
            bigBranchNumber7: 0,
            bigBranchNumber8: 0,
            bigBranchNumber9: 0,
            bigBranchNumber10: 0,

            branchNumberAvg: 0.0,

            // 大薯测产
            bigYield1: 0.0,
            bigYield2: 0.0,
            bigYield3: 0.0,
            bigYield4: 0.0,
            bigYield5: 0.0,
            bigYield6: 0.0,
            bigYield7: 0.0,
            bigYield8: 0.0,
            bigYield9: 0.0,
            bigYield10: 0.0,

            // 小薯测产
            smallYield1: 0.0,
            smallYield2: 0.0,
            smallYield3: 0.0,
            smallYield4: 0.0,
            smallYield5: 0.0,
            smallYield6: 0.0,
            smallYield7: 0.0,
            smallYield8: 0.0,
            smallYield9: 0.0,
            smallYield10: 0.0,

            // 备注信息
            remark: ''
          }
        },

        speciesImgs: {
          img1: '',
          img2: '',
          img3: '',
          img4: '',
          img5: ''
        },
        editStatus: false,
        ruleForm: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        rules: {
          name: [
            {required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur'}
          ],
          region: [
            {required: true, message: '请选择活动区域', trigger: 'change'}
          ],
          date1: [
            {type: 'date', required: true, message: '请选择日期', trigger: 'change'}
          ],
          date2: [
            {type: 'date', required: true, message: '请选择时间', trigger: 'change'}
          ],
          type: [
            {type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change'}
          ],
          resource: [
            {required: true, message: '请选择活动资源', trigger: 'change'}
          ],
          desc: [
            {required: true, message: '请填写活动形式', trigger: 'blur'}
          ]
        }
      }
    },

    created() {
      // 刚打开页面时就去取数据；
      this.curSpecies = this.GLOBAL.species
      this.fetchData()
    },

    methods: {
      getplantHeightAvg() {
        var totalHeight = 0.00
        //totalHeight = this.plotData.plantHeightAvg
        totalHeight = ((parseInt(this.plotData.bigPlantHeight1) + parseInt(this.plotData.bigPlantHeight2) + parseInt(this.plotData.bigPlantHeight3) + parseInt(this.plotData.bigPlantHeight4) + parseInt(this.plotData.bigPlantHeight5) +
          parseInt(this.plotData.bigPlantHeight6) + parseInt(this.plotData.bigPlantHeight7) + parseInt(this.plotData.bigPlantHeight8) + parseInt(this.plotData.bigPlantHeight9) + parseInt(this.plotData.bigPlantHeight10)) / 10).toFixed(2)

        this.plotData.plantHeightAvg = totalHeight
      },

      getBranchNumber() {
        this.plotData.commontest.branchNumberAvg = ((parseInt(this.plotData.commontest.bigBranchNumber1) + parseInt(this.plotData.commontest.bigBranchNumber2) + parseInt(this.plotData.commontest.bigBranchNumber3)
          + parseInt(this.plotData.commontest.bigBranchNumber4) + parseInt(this.plotData.commontest.bigBranchNumber5) + parseInt(this.plotData.commontest.bigBranchNumber6)
          + parseInt(this.plotData.commontest.bigBranchNumber7) + parseInt(this.plotData.commontest.bigBranchNumber8) + parseInt(this.plotData.commontest.bigBranchNumber9)
          + parseInt(this.plotData.commontest.bigBranchNumber10)) / 10).toFixed(2)
      },
      fetchData() {
        // console.log("earlymaturing_identify.vue页面获取全局species.speciesId:" + this.GLOBAL.plot.plotId)//到此为止没问题；
          this.listLoading = true
        console.log("TESTID:" + this.GLOBAL.species.testId)
        getSpeciesCommontestList(this.GLOBAL.species.testId).then(response => {
          console.log('response中获取的 testId:' + response.data.rows[0].speciesId)
          this.plotData = response.data.rows[0]
          this.speciesImgs.img1 = 'http://cxk.nicesite.vip/' + response.data.rows[0].localSpecies.img1
          this.speciesImgs.img2 = 'http://cxk.nicesite.vip/' + response.data.rows[0].localSpecies.img2
          this.speciesImgs.img3 = 'http://cxk.nicesite.vip/' + response.data.rows[0].localSpecies.img3
          this.speciesImgs.img4 = 'http://cxk.nicesite.vip/' + response.data.rows[0].localSpecies.img4
          this.speciesImgs.img5 = 'http://cxk.nicesite.vip/' + response.data.rows[0].localSpecies.img5


        })
      },
      submitUpdation() {
        updateCommontest(this.plotData).then(response => {
          if (response.data.success === true) {
            this.$notify({
              title: '成功',
              message: '更新成功',
              type: 'success',
              duration: 2000
            })
          } else {
            this.$notify({
              title: '失败',
              message: '更新失败',
              type: 'failure',
              duration: 3000
            })
          }

        })
      },
      returnAllSpecies() {
        this.$router.push('/speciesList')
      },
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.$notify({
              title: '成功',
              message: '提交成功',
              type: 'success',
              duration: 2000
            })
          } else {
            console.log('error submit!!')
            return false
          }
        })
      },
      resetForm(formName) {
        this.$refs[formName].resetFields()
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .el-radio-button__orig-radio:disabled:checked+.el-radio-button__inner {
    background-color: #909399;
  }

  .clear {
    clear: both;
  }

  .el-form-item {
    max-width: 600px;
    float: left;
  }

  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 200px;
    margin: 0;
  }

  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>



